<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/XGameAdmin_template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<?php
include('lock.php');

if($_SERVER["REQUEST_METHOD"] == "POST")
{
	if(!empty($_POST['editID'])){
	$_SESSION['edit_ID'] = addslashes($_POST['editID']);
	}
	$id = $_SESSION['edit_ID'];
	
	if(!empty($_POST['contact']) || !empty($_POST['address']) || !empty($_POST['name']) || !empty($_POST['email']))
	{
		$name = addslashes($_POST['name']);
		$email = addslashes($_POST['email']);
		$contact = addslashes($_POST['contact']);
		$address = addslashes($_POST['address']);
		$sql1="UPDATE user SET user_contact='$contact', user_address='$address', user_name='$name', user_email='$email' WHERE user_ID='$id'";
		mysql_query($sql1);
		unset($_SESSION['edit_ID']);
		header('Location: AdminMember.php');
	}
	
	
	$sql = "SELECT * FROM user Where user_ID = '$id'";
	$result=mysql_query($sql);
	$row=mysql_fetch_array($result);
	
}


?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->
<link type="text/css" rel="stylesheet" href="CSS/adminCSS.css" />
</head>

<body>
<div id="container">

<div id="wrapper">

<div id="banner">
<ul class="topLink">
<li> Welcome, Admin </li>
<li> <a href="Logout.php"> Logout </a> </li>
</ul>

<img src="Assets/XGame.png" alt="XGame" />
</div>

<div id="menu">

<ul class="nav">
<li> <a href="AdminMember.php"> Member </a> </li>
<li> <a href="AdminNews.php"> News </a> </li>
<li> <a href="AdminGames.php"> Games </a> </li>
<li> <a href="AdminStock.php"> Stock </a> </li>
<li> <a href="AdminOrder.php"> Order </a> </li>
<li> <a href="AdminHistory.php"> History </a> </li>
</ul>

</div>

<div id="main">
<!-- InstanceBeginEditable name="Main" -->
<form id="registerUpdate" name="registerUpdate" method="POST">
<h3> User Particular </h3>

<label>Username</label>
<input type="text" name="name" value="<?php echo $row["user_name"]; ?>"/>

<label>Email</label>
<input type="email" name="email" value="<?php echo $row["user_email"]; ?>"/>

<label>Address</label>
<input type="text" name="address" value="<?php echo $row["user_address"]; ?>"/>

<label>Contact Number</label>
<input type="text" name="contact" value="<?php echo $row["user_contact"]; ?>"/>

<button type="submit">Update</button>

</form>
<!-- InstanceEndEditable -->
</div>

<div id="footer">
<p align="center"> &copy; &nbsp; 2012 XGame </p>
</div>

</div>

</div>

</body>
<!-- InstanceEnd --></html>
